package wang.Seacher.util;

import java.util.List;
import java.util.Map;

import org.apache.commons.lang3.StringUtils;

public class JudgeUtil {

	/**
	 * list是否存在且有效
	 */
	public static boolean isPresent(List<?> list) {
		boolean returnBoolen = false;
		if (list != null && list.size() > 0) {
			returnBoolen = true;
		}
		return returnBoolen;
	}
	
	/**
	 * map是否存在且有效
	 */
	public static boolean isPresent(Map<?,?> map) {
		boolean returnBoolen = false;
		if (map != null && map.size() > 0) {
			returnBoolen = true;
		}
		return returnBoolen;
	}

	/**
	 * integer是否存在
	 */
	public static boolean isPresent(Integer integer) {
		boolean returnBoolen = false;
		if (integer != null) {
			returnBoolen = true;
		}
		return returnBoolen;
	}
	
	/**
	 *  String是否存在,且不为空
	 */
	public static boolean isPresent(String str) {
		boolean returnBoolen = false;
		if (StringUtils.isNotBlank(str)) {
			returnBoolen = true;
		}
		return returnBoolen;
	}
	
	/**
	 * o对象是否存在
	 */
	public static	boolean isPresent(Object o) {
		boolean returnBoolen = false;
		if (o != null) {
			returnBoolen = true;
		}
		return returnBoolen;
	}
}